import React from 'react';
import { HashRouter, Routes, Route, Navigate } from 'react-router-dom'
import { Suspense } from 'react'
import Login from './pages/login'
import Layout from './pages/layout'
import zhCN from 'antd/es/locale/zh_CN';
import { ConfigProvider } from 'antd'
import HomePage from './pages/homePage'
import User from './pages/system/user'
import Role from './pages/system/role'
import Menu from './pages/system/menu'
import Dict from './pages/system/dict'
import Profile from './pages/profile'
function App() {
  return (
    <ConfigProvider locale={zhCN}>
      <Suspense>
        <HashRouter>
          <Routes>
            <Route path='/' element={<Navigate to='/login'></Navigate>}></Route>
            <Route path='/login' element={<Login></Login>}></Route>
            <Route path='/home' element={<Layout></Layout>}>
              <Route index element={<HomePage></HomePage>}></Route>
              <Route path='homepage' element={<HomePage></HomePage>}></Route>
            </Route>
            <Route path='/profile' element={<Layout></Layout>}>
              <Route index element={<Profile></Profile>}></Route>
            </Route>
            <Route path='/system' element={<Layout></Layout>}>
              <Route path='user' element={<User></User>}></Route>
              <Route path='role' element={<Role></Role>}></Route>
              <Route path='menu' element={<Menu></Menu>}></Route>
              <Route path='dict' element={<Dict></Dict>}></Route>
            </Route>
          </Routes>
        </HashRouter>
      </Suspense>
    </ConfigProvider>

  )
}

export default App
